
// 查看用例执行结果明细
$(function () {
   $(".preview-res-btn").click(function (event) {
        var self = $(this);
        event.preventDefault();
        var dialog = $("#preview-res-dialog");
        dialog.modal("show");

        var tr = self.parent().parent();

        var cost_time = tr.attr("data-cost_time") + ' ms';
        var res_case_name = tr.attr("data-res_case_name");
        var res_case_sign = tr.attr("data-res_case_sign");
        var res_case_path = tr.attr("data-res_case_path");
        var res_case_param = tr.attr("data-res_case_parm");
        var expect_res = tr.attr("data-expect_res");
        var res_header = tr.attr("data-res_header");
        var res_detail = tr.attr("data-res_detail");
        var res_status = tr.attr("data-res_status");
        var res_http_code = tr.attr("data-res_http_code");
        var create_at = tr.attr("data-create_at");
        var run_type = tr.attr("data-run_type");
        var wheel_no = tr.attr("data-wheel_no");
        var res_id = tr.attr("data-res_id");
        var planName = tr.attr("data-res_plan");
        var plan_isDel = tr.attr("data-plan_isDel");
        if(plan_isDel == 1){
             var plan_isDel_desc = '【已删除】'
        }else {
             var plan_isDel_desc = ''
        }
        var res_plan = planName + plan_isDel_desc;

        var res_case_nameE = dialog.find("input[name='preview-res_case_name']");
        var res_case_signE = dialog.find("input[name='preview-res_case_sign']");
        var res_case_pathE = dialog.find("textarea[name='preview-res_case_path']");
        var res_case_paramE = dialog.find("textarea[name='preview-res_case_param']");
        var expect_resE = dialog.find("input[name='preview-expect_res']");
        var res_headerE = dialog.find("textarea[name='preview-res_header']");
        var res_detailE = dialog.find("textarea[name='preview-res_detail']");
        var res_statusE = dialog.find("input[name='preview-res_status']");
        var res_http_codeE = dialog.find("input[name='preview-res_http_code']");
        var create_atE = dialog.find("input[name='preview-create_at']");
        var run_typeE = dialog.find("input[name='preview-run_type']");
        var wheel_noE = dialog.find("input[name='preview-wheel_no']");
        var res_idE = dialog.find("input[name='preview-res_id']");
        var res_planE = dialog.find("input[name='preview-res_plan']");
        var cost_timeE = dialog.find("input[name='preview-cost_time']");

        res_case_nameE.val(res_case_name);
        res_case_signE.val(res_case_sign);
        res_case_pathE.val(res_case_path);
        res_case_paramE.val(res_case_param);
        expect_resE.val(expect_res);
        res_headerE.val(res_header);
        res_detailE.val(res_detail);
        res_statusE.val(res_status);
        res_http_codeE.val(res_http_code);
        create_atE.val(create_at);
        run_typeE.val(run_type);
        wheel_noE.val(wheel_no);
        res_idE.val(res_id);
        res_planE.val(res_plan);
        cost_timeE.val(cost_time);

   });
});